package org.jivesoftware.smackx.pubsub.provider;

import java.util.Iterator;
import java.util.List;
import java.util.Map;
import org.jivesoftware.smack.packet.PacketExtension;
import org.jivesoftware.smackx.Form;
import org.jivesoftware.smackx.packet.DataForm;
import org.jivesoftware.smackx.provider.EmbeddedExtensionProvider;
import org.jivesoftware.smackx.pubsub.FormNode;
import org.jivesoftware.smackx.pubsub.FormNodeType;

public class FormNodeProvider extends EmbeddedExtensionProvider
{
  protected PacketExtension createReturnExtension(String paramString1, String paramString2, Map<String, String> paramMap, List<? extends PacketExtension> paramList)
  {
    return new FormNode(FormNodeType.valueOfFromElementName(paramString1, paramString2), (String)paramMap.get("node"), new Form((DataForm)paramList.iterator().next()));
  }
}